/*
 * FPS.h
 *
 *  Created on: 03/05/2011
 *      Author: Rafael
 */

#ifndef FPS_H_
#define FPS_H_

#define FACTOR 2.0f

#include <SDL/SDL.h>
#include "util/Timer.h"

// singleton
class FPS {
private:
	Timer timer;
	int frames;
	int numFrames;
	unsigned int oldTime;
	unsigned int lastTime;
	double delta; // in seconds
	FPS();
	static FPS *s_instance;
public:
	static FPS *Instance();
	virtual ~FPS();
	/*
	 * Methods
	 */
	bool constantFPS();
	void onLoop();
	int getFPS();
	double getDelta();
};

#endif /* FPS_H_ */
